package org.jobtask.ui;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;

public class TaskAbout extends JDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3668989611953588307L;

	public TaskAbout(){
		this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		JLabel centerLab=new JLabel(new ImageIcon(this.getClass().getResource("images/about-dialog.png")));
		Container contain=this.getContentPane();
		contain.add(centerLab);
		JButton close=new JButton("");
		close.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				TaskAbout.this.dispose();
			}
		});
		contain.add(close,BorderLayout.PAGE_END);
		this.setModal(true);
		this.setSize(472,275);
		this.setResizable(false);
	}
	
	public void showDialog(Component owner){
		this.setLocationRelativeTo(owner);
		this.setVisible(true);
	}
	
}
